﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace BrainTechLLC.BaseLibrary
{
    public class BasicBitmapPopulator
    {
        public virtual Bitmap Populate(BasicBitmap item)
        {
            Bitmap populated = null;
            item.Bitmap = populated;
            item.BitmapWidth = populated == null ? 0 : populated.Width;
            item.BitmapHeight = populated == null ? 0 : populated.Height;

            return populated;
        }

        public virtual Bitmap PopulateIfEmpty(BasicBitmap item)
        {
            Bitmap populated = item.Bitmap;
            if (populated == null)
            {
                populated = Populate(item);
            }
            return populated;
        }
    }
}
